<template>
    <div>
        <h3>房号列表</h3>
        <table class="table table-bordered">
            <tbody>
                <tr class="bg-primary">
                    <td>房号编号</td>
                    <td>房号号码</td>
                    <td>房型名称</td>
                    <td>房价</td>
                    <td>房间数量</td>
                    <td>状态</td>
                    <td>操作</td>
                </tr>
                <tr v-for="item in data" :key="item.NumId">
                    <td>{{ item.NumId }}</td>
                    <td>{{ item.HouseNumName }}</td>
                    <td>{{ item.HouseTypeName }}</td>
                    <td>{{ item.HousePrice }}</td>
                    <td>{{ item.Housemany }}</td>
                    <td>{{ item.State==1?'启用':'禁用' }}</td>
                    <td></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import axios from 'axios';
import moment from 'moment';
import { useRoute, useRouter } from 'vue-router';
import { idText } from 'typescript';
import router from '@/router';
const Route = useRoute();
const Router = useRouter();

let data:any=ref([])
onMounted(()=>{
    getlist();
})
const getlist=()=>{
    axios({
        url:'/api/House/GetHouseNumsList',
        method:'get',
        
    })
    .then((res)=>{
        console.log(res);
        data.value=res.data;
    })
    .catch((err)=>{
        console.log(err);
        
    })
}
</script>

<style scoped>

</style>